/**
 * CustomerDepartment实体类
 *
 * @author sxf
 * @email sxf02615@163.com
 * @date 2025/1/15
 */
package com.sxf.crm.entity;


import jakarta.persistence.*;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

/**
 * 客户部门关系实体类
 *
 * @author sxf
 * @email sxf02615@163.com
 * @date 2025/6/1
 */
@Data
@Entity
@Table(name = "customer_departments")
@IdClass(CustomerDepartmentId.class)
@JsonIgnoreProperties({"hibernateLazyInitializer", "handler"})
public class CustomerDepartment {
    @Id
    @ManyToOne
    @JoinColumn(name = "customer_id")
    private Customer customer;

    @Id
    @ManyToOne
    @JoinColumn(name = "department_id")
    private Department department;

    @ManyToOne
    @JoinColumn(name = "sales_id")
    private User sales;

    private Long createAt;

    private Long createUserId;

    private Long updateAt;

    private Long updateUserId;
} 